<?php 
error_reporting(0);
function  qwget360($url,$timeout = 20) {  
    $user_agent = "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36";  
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, $url);
	curl_setopt($curl, CURLOPT_USERAGENT,$user_agent);
    curl_setopt($curl, CURLOPT_REFERER,$url) ;
    curl_setopt($curl, CURLOPT_AUTOREFERER, 1);                
    curl_setopt($curl, CURLOPT_TIMEOUT, $timeout);
    curl_setopt($curl, CURLOPT_HEADER, 0);
   curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($curl, CURLOPT_FOLLOWLOCATION,1);
	curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, '0');
	curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, '0');
	curl_setopt($curl, CURLOPT_ENCODING, '');
    return curl_exec($curl);  
}
function yycmsyzcsa($C_url){
    $str="/^[a-z0-9]+$/";  
    if (!preg_match($str,$C_url)){  
        return false;  
    }else{  
    return true;  
    }  }	
if(empty($_GET['cat'])){$cat="all";}else{$cat=$_GET['cat'];}
if(empty($_GET['year'])){$year="all";}else{$year=$_GET['year'];}
if(empty($_GET['area'])){$area="all";}else{$area=$_GET['area'];}
if(empty($_GET['act'])){$act="all";}else{$act=$_GET['act'];}
if(empty($_GET['rank'])){$rank="all";}else{$rank=$_GET['rank'];}
$yycmsfl=isset($yycmsfl)?$yycmsfl:'dianshi';
if(empty($_GET['pageno'])){$pageno="1";}else{$pageno=$_GET['pageno'];}
$url="$yycmszd/$yycmsfl/list.php?rank=$rank&cat=$cat&year=$year&area=$area&act=$act&pageno=$pageno";
mkdir('./cache');
mkdir('./cache/yingshi');
if($yycms_a_hckg == '1'){
$gxpd=time()-filemtime('./cache/yingshi/'.md5($url));
if($gxpd>$yycms_a_hcsj*60*60){
$data=gett($url);	
file_put_contents('./cache/yingshi/'.md5($url),gzdeflate($data));
}
$info=gzinflate(file_get_contents('./cache/yingshi/'.md5($url)));
}else{
$info=gett($url);
}
$urll='#<a class="js-tongjic" href="(.*)">#';
$continu='#<span class="hint">(.*)</span>#';
$point='#<span class="point">(.*)</span>#';
$name='#<span class="s1">(.*)</span>#';
$actor='#<p class="star">(.*?)</p>#';
$pic='#<div class="cover g-playicon">[\s\S]*?<img src="(.*?)">#';
$total="#<a href='(.*?)' target='_self' monitor-shortpv-c-sub='(.*?)'>(.*?)</a>#";

preg_match_all($urll, $info,$url);
preg_match_all($continu, $info,$vod_continu);
preg_match_all($point, $info,$vod_point);
preg_match_all($name, $info,$vod_name);
preg_match_all($actor, $info,$vod_actor);
preg_match_all($pic, $info,$vod_pic);
preg_match_all($total, $info,$vod_total);
$total=end($vod_total[2]);
if ((int)$pageno>(int)$total){
	$total=$pageno;
}
$yycms = array("yycmsys_total" => isset($total)?$total:'1');
foreach($url[1] as $k=>$vod_url){	
$yycms['yycmsys'][] = array(
			"yycmsys_url"=> $vod_url,
			"yycmsys_name"=> $vod_name[1][$k],
			"yycmsys_actor" => $vod_actor[1][$k],
			"yycmsys_content"=> $vod_continu[1][$k],
			"yycmsys_point"=> $vod_point[1][$k],
			"yycmsys_pic"=> $vod_pic[1][$k]
		);	
}
?>
